package com.jnevision.replacecard.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jnevision.common.CommonQuery;
import com.jnevision.replacecard.mapper.ReplaceCardMapper;
import com.jnevision.replacecard.model.ReplaceCard;
import com.jnevision.replacecard.model.ReplaceCardVO;

/**
 * <p>
 * 补卡申请 服务实现类
 * </p>
 *
 * @author gavin
 * @since 2019-07-15
 */
@Service
public class ReplaceCardServiceImpl extends ServiceImpl<ReplaceCardMapper, ReplaceCard> {

	@Autowired
	private ReplaceCardMapper replaceCardMapper;
	
    public List<ReplaceCardVO> getApprove(String userId) {
        return this.baseMapper.getApprove(userId);
    }

    public ReplaceCardVO getApproveDetail(String replaceCardRecordId) {
        return this.baseMapper.getApproveDetail(replaceCardRecordId);
    }

	public R<IPage<ReplaceCardVO>> page(Page<ReplaceCardVO> page, CommonQuery commonQuery,Integer result) {
		return R.ok(this.replaceCardMapper.page(page,commonQuery,result));
	}
}
